package github.saw96x.loadbalance;

import github.saw96x.common.extension.SPI;
import github.saw96x.remoting.pojo.RpcRequest;

import java.util.List;

/**
 * 负载均衡策略接口
 *
 * @author Saw96x
 * @date 2022/3/18 11:58
 */
@SPI
public interface LoadBalance {
  /**
   * 从服务地址列表选一个
   *
   * @param serviceUrlList Service address list
   * @param rpcRequest
   * @return target service address
   */
  String selectServiceAddress(List<String> serviceUrlList, RpcRequest rpcRequest);
}
